/*
 * logger.h
 *
 *  Created on: Dec 13, 2011
 *      Author: piotrek
 */

#ifndef LOGGER_H_
#define LOGGER_H_

#define BUF_SIZE 4000

#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <pthread.h>
#include <string.h>
#include <time.h>

#define LOG_MSG(msg) log_msg(__FILE__, __LINE__, msg)

struct logger
{
	int *descriptors;
	int n;
	int size;
};

struct logger* init_logger(int n);
void add_file_logger(struct logger *logger, char *filename);
void add_console_logger(struct logger *logger);
void dispose_logger(struct logger *logger);
struct logger* get_logger();
void log_msg(const char *filename, int lineno, const char *text);

#endif /* LOGGER_H_ */
